#!/usr/bin/env python
# -*- coding: utf-8 -*-

from sqlalchemy import Boolean, Column, Integer, String, text, TIMESTAMP, BigInteger
from sqlalchemy.orm import relationship

from app.db.base_class import Base


class Strategy(Base):
    __tablename__ = 'tb_strategy'

    id = Column(BigInteger, primary_key=True)
    userId = Column('user_id', Integer)
    parentId = Column('parent_id', Integer)
    name = Column(String(64))
    level = Column(Integer)
    password = Column(String(64))
    drawType = Column(String(16))
    description = Column(String(128))
    createdDate = Column('created_date', TIMESTAMP, server_default=text('CURRENT_TIMESTAMP'))
    updatedDate = Column('updated_date', TIMESTAMP,
                         server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'))

    # def __getitem__(self, item):
    #     return self.__getattribute__(item)